home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Collections: Various
/
S.N.A.G. Disk of the Month 90-07 (1990)(Southern Nevada Amiga Group)(PD).zip
/
S.N.A.G. Disk of the Month 90-07 (1990)(Southern Nevada Amiga Group)(PD).adf
/
Utilities
/
MMove!
/
MMove.c
< prev
next >
Wrap
C/C++ Source or Header
|
1990-06-21
|
1KB
|
61 lines
#include <StdIO.h>
#include <Intuition/IntuitionBase.h>
#include <Intuition/Intuition.h>
struct IntuitionBase
*OpenLibrary();
struct IntuitionBase
*IntuitionBase = NULL;
main(Args, Coords)
int
Args;
char
*Coords[];
{
void
ShowUsage();
short int
X,
Y;
if (Args != 3)
ShowUsage();
else
{
X = atoi(Coords[1] );
Y = atoi(Coords[2] );
if ( (X < 0) || (X > 639) || (Y < 0) || (Y > 399) )
ShowUsage();
else
{
IntuitionBase = (struct IntuitionBase *)OpenLibrary( \
"intuition.library", LIBRARY_VERSION);
if (IntuitionBase != NULL)
{
IntuitionBase->MouseX = (long int)X;
IntuitionBase->MouseY = (long int)Y;
ActivateWindow(IntuitionBase->ActiveWindow);
CloseLibrary(IntuitionBase);
}
else
{
printf("Error openning intuition.library.\n");
}
}
}
}
void ShowUsage()
{
printf("Proper usage is: MMove X Y. ");
printf("Where X is 0 - 639 and Y is 0 - 399.\n");
}